﻿<Window x:Class="Esponce.Views.MainWindow"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:m="clr-namespace:Esponce.Models"
	xmlns:v="clr-namespace:Esponce.Views"
	Title="Esponce QR Code API 3.0 Demo"
	Icon="/Resources/esponce.ico"
	Width="900" Height="768"
	MinWidth="900" MinHeight="768">
	<Window.DataContext>
		<m:MainViewModel />
	</Window.DataContext>
	<Grid x:Name="LayoutRoot" Background="#E5E5E5">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="1.5*" />
			<RowDefinition Height="1*" />
		</Grid.RowDefinitions>

		<!-- Background for header -->
		<Grid Grid.Row="0" Grid.RowSpan="2" Background="#182227" />

		<Grid Grid.Row="0" Grid.RowSpan="2">
			<Grid.Background>
				<ImageBrush ImageSource="/Resources/header.png" Stretch="None" AlignmentX="Center" AlignmentY="Top" />
			</Grid.Background>
			<Grid.Effect>
				<DropShadowEffect Color="#333333" Opacity="0.5" ShadowDepth="0" BlurRadius="10" />
			</Grid.Effect>
		</Grid>

		<!-- Select a method -->
		<Grid Grid.Row="0" Margin="20,20,20,10">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="75" />
				<ColumnDefinition Width="*" />
				<ColumnDefinition Width="Auto" />
				<ColumnDefinition Width="72" />
				<ColumnDefinition Width="Auto" />
				<ColumnDefinition Width="72" />
			</Grid.ColumnDefinitions>

			<Grid Grid.Column="0">
				<TextBlock Text="API method:" VerticalAlignment="Center" Foreground="White" />
			</Grid>
			<ComboBox Grid.Column="1" ItemsSource="{Binding ServiceMethodList}" SelectedItem="{Binding SelectedServiceMethod}" />

			<Grid Grid.Column="2">
				<TextBlock Text="Format:" VerticalAlignment="Center" Margin="10,0,10,0" Foreground="White" />
			</Grid>
			<ComboBox Grid.Column="3" ItemsSource="{Binding DataFormatList}" SelectedItem="{Binding SelectedDataFormat}" />

			<Grid Grid.Column="4">
				<TextBlock Text="SSL:" VerticalAlignment="Center" Margin="10,0,10,0" Foreground="White" />
			</Grid>
			<ComboBox Grid.Column="5" ItemsSource="{Binding CertificateStateList}" SelectedItem="{Binding SelectedCertificateState}" />

		</Grid>

		<Grid Grid.Row="1" Margin="20,0,20,20">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="75" />
				<ColumnDefinition Width="*" />
				<ColumnDefinition Width="Auto" />
			</Grid.ColumnDefinitions>
			<TextBlock Text="API key:" Grid.Column="0" VerticalAlignment="Center" Foreground="White" />
			<TextBox Grid.Column="1" Text="{Binding ApiKey, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalContentAlignment="Center" />
		</Grid>

		<!-- Content -->
		<Grid Grid.Row="2" Margin="20,20,20,20">
			<ContentPresenter Content="{Binding View}" />
		</Grid>

		<!-- Log window -->
		<Grid Grid.Row="3" Margin="20,0,20,20">
			<v:LogView x:Name="logger" />
		</Grid>
		
	</Grid>
</Window>
